<?php

namespace App\Http\Requests\Admin\BosImageUpload;

use App\Http\Requests\ApiRequest;
use Illuminate\Http\UploadedFile;

/**
 * @property UploadedFile[] images
 */
class MultiBosImageStoreRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'images.*'     => 'required|file',
            'images'       => 'required|array|min:1',
        ];
    }

    /**
     * @return array
     */
    public function messages()
    {
        return [
            'images.*.*'   => 'image file 必须为文件',
            'images.*'     => 'images 必须是数组',
        ];
    }

}
